package com.ruoyi.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.web.domain.MesBindingAllocation;
import com.ruoyi.web.domain.MesMakeVersion;
import com.ruoyi.web.domain.mes.MesMachinePaper;
import com.ruoyi.web.domain.mes.MesPaperTonFactor;
import com.ruoyi.web.domain.vo.MachineInventoryVo;
import com.ruoyi.web.domain.vo.MachinePieceByTechnologyVo;
import com.ruoyi.web.domain.vo.NWProducePrint;
import com.ruoyi.web.domain.vo.ScheduleVo;
import com.ruoyi.web.vo.*;

import java.math.BigDecimal;
import java.util.List;

public interface ProduceMapper extends BaseMapper<Produce> {

    public List<MesPaperTonFactor> getPaperTonByParams(MesPaperTonFactor mesPaperTonFactor);

    public List<Produce> selectProduce();

    //原查待取板数据
    public List<Produce> taskMachine(String machineId);

    //新查待取板数据
    public List<Produce> nwtakeMachine(Produce produce);
    public List<Produce> fmtakeMachine(Produce produce);
    public List<Produce> producemindate(String machineId);
    public List<Produce> waittakedate(String machineId);


    //查询待装订数据
    public List<Produce> bingMachineTask(Produce produce);
    public List<Produce> bingMachineTaskTempSubmit(Produce produce);
    public List<ScheduleVo> bindFMTask(Produce produce);


    public List<Produce> allocationtakeMachine(Produce produce);


    public int machineNwCount(String machineId);

    public int machineFmCount(String machineId);

    public String selectRoleKeyBuUserId(Long userId);
    public List<Produce> selectProduceList(String produceNo);
    public List<Produce> selectProduceListOld(String produceNo);
    public List<Produce> GetReportProduce(Produce produce);
    public List<Produce> GetProducelistByMachineId(Produce produce);
    public List<ProducePrint> selectOldPrintListByProduceId(String pid);
    public List<ProducePrint> selectNewPrintListByProduceId(String pid);

    public List<Produce> getList(Produce produce);
    public List<Produce> waitProduce(Produce produce);
    public List<Produce> waitBinding(Produce produce);
    public List<Produce> waitBindingpc(Produce produce);
    public List<MesMachine> getprinttask(String machineId);
    public List<Produce> allocationProduceId(Produce produce);
    public List<Produce> bindingProduceId(MesBindingAllocation bindingAllocation);


    public List<Produce> getListFM(Produce produce);
    public List<Produce> getListFM2(Produce produce);

    public List<Produce> getListFMDetail(Produce produce);


    public List<Produce> getProduceCovingByOrderId(Produce produce);

    public List<MesMachine> getTaskLeast(MesMachine machine);


    public List<MachineTask> getMachineTask(MachineTask machineTask);
    public MachineTask getMachineTaskSum(MachineTask machineTask);
    public List<MachineTask> getnotMachineTask(MachineTask machineTask);
    public MachineTask getnotMachineTaskSum(MachineTask machineTask);

    public List<MachineTask> bindingMachineTask(MachineTask machineTask);
    public List<MachineTask> bindingnotMachineTask(MachineTask machineTask);

    public List<MachineTask> bindingTask(MachineTask machineTask);
    public List<MachineTask> bindingnotTask(MachineTask machineTask);


    public List<Produce> getUseProduce(String machineId);

    public List<MesMachine> getTypeLeast(MesMachine machine);
    public List<MesMachine> getcoverLeast(MesMachine machine);

    public List<MesMachine> getbindingLeast(String machineIds);
    public List<MesMachine> getbindingcount(String machineIds);

    public int BindingFPMachine(ProducePrint print);


    //查询平板双色机任务量最少的
    public List<MesMachine> getflatLeast(MesMachine machineIds);

    public List<ProduceProduct> bindingFilter(MesMachine machine);

    public List<ProduceProduct> bindingTechnologyProduct(ProduceProduct product);

    public List<ProducePiece> bindingPiece(MesMachine machine);

    public Integer getPieceCount(ProducePiece producePiece);

    public List<MesProducePieceMachine> getMachineTotal(MesProducePieceMachine producePieceMachine);

    public List<MesProducePieceMachine> getMachinePaperTotal(MesProducePieceMachine producePieceMachine);

    public List<MesProducePieceMachine> ProducePieceMachinelist(String pieceId);

    public List<ProducePiece> ProducePieceList(ProducePiece producePiece);

    public int updateProducePieceMachine(MesProducePieceMachine mesProducePieceMachine);

    public int updateProducePieceMachineStatus(String produceId);

    public int updateFMProduceDetail(Produce produce);

    //作废bom清单
    public int updateStatusBom(String produceId);

    // 取消生产单暂提
    public int updateTempStatus(String produceId );


    public List<Produce> getProduceList(Produce produce);


    public List<Produce> getschedule(Produce data);
    public Produce getscheduleSum(Produce data);


    public List<ScheduleVo> getschedulenw(String produceId);
    public List<ScheduleVo> getschedulefm(String produceId);
    public List<ScheduleVo> getNWSchedule(Produce produce);
    public List<ScheduleVo> getPlannedBindOrPrintTasks(Produce produce);
    public ScheduleVo getPlannedBindOrPrintTasksSum(Produce produce);

    public List<ScheduleVo> GetBinding(Produce produce);
    public ScheduleVo selectSumNum(Produce produce);
    public ScheduleVo selectSumNWFhDateNum(Produce produce);

   //已排产的装订生产单
    public List<ScheduleVo>  getPlannedBindingTasks(Produce produce);
    //已排产印刷生产单
    public List<ScheduleVo>  getPlannedPrintTasks(Produce produce);

    public ScheduleVo selectPlannedBindSumNum(Produce produce);
    public ScheduleVo selectPlannedBindFhDateNum(Produce produce);
    //问题订单
    public List<ScheduleVo> getQuestionNWSchedule(Produce produce);
    public ScheduleVo   selectQuestionSumNum(Produce produce);
    public ScheduleVo selectQuestionSumNWFhDateNum(Produce produce);

    public List<ScheduleVo> getFMSchedule(Produce produce);

    public List<ScheduleVo> getWaitPrint(Produce produce);
    public ScheduleVo  selectWaitPrintSumNum(Produce produce);
    //欠货数据统计
    public List<ScheduleVo> getShortageGoods(Produce produce);
    public ScheduleVo getShortageGoodsUrgentDate(Produce produce);
    //待装订
    public ScheduleVo selectPaperSumNum(Produce produce);
    public ScheduleVo selectUrgentSumNum(Produce produce);
    public ScheduleVo GetBindingSum(Produce produce);
    public List<MachinePieceByTechnologyVo> selectMachineAndPieceByTechnology(Produce produce);

     //已发货
     public List<ScheduleVo> getInvoiceList(Produce produce);
    public ScheduleVo getInvoiceListSum(Produce produce);
    public ScheduleVo  getInvoiceLingCountSum(Produce produce);

    public BigDecimal getMinProducePieceMachineByIds(String pieceIds);
    //根据生产单id和机台id查询待取板数据
    public  List<ProducePiece> getTakeStay(Produce produce);

    public List<NWProducePrint> selectNWProducePrint(Produce produce);

    public List<MachineInventoryVo> selectMachineInventoryList(MachineInventoryVo machineInventory);
    BigDecimal selectMachineInventorySum(MachineInventoryVo machineInventory);

    public List<Produce> GetProducelistByMachineIdAll(Produce produce);
    public List<Produce> GetProducelistByMachineIdFold(Produce produce);
    public List<Produce> GetProducelistByMachineIdCut(Produce produce);
    public List<Produce> GetProducelistByMachineIdCover(Produce produce);

    public int updateProductCount(ProduceProduct produceProduct);
    public List<Produce> getDeliveryList(Produce produce);

    public int Withdrawupdate(String produceId);
    public int Withdrawdelete(String produceId);
}
